import request from "@/utils/request";

export default {
  // 删除品牌
  remove(id) {
    return request({
      url: `/admin/product/baseTrademark/remove/${id}`,
      method: "delete",
    });
  },
  // 添加和修改品牌
  addOrUpdate(trademark) {
    if (trademark.id) {
      //修改
      return request({
        url: `/admin/product/baseTrademark/update`,
        method: "put",
        data: trademark,
      });
    } else {
      //增加
      return request({
        url: "/admin/product/baseTrademark/save",
        method: "post",
        data: trademark,
      });
    }
  },
  // 根据页码获取分页列表
  getPageList(page, limit) {
    return request({
      url: `/admin/product/baseTrademark/${page}/${limit}`,
      method: "get",
    });
  },
  // 获取所有的品牌列表
  getTrademarkList() {
    return request({
      url: `/admin/product/baseTrademark/getTrademarkList`,
      method: "get",
    });
  },
};
